import request from '/@/utils/request';

// import { Role } from './types';
export function roleApi() {
	return {
		addRole: (data: object) => {
			return request({
				url: '/role/add',
				method: 'post',
				data,
			});
		},
		deleteRole: (params: object) => {
			return request({
				url: '/role/delete',
				method: 'delete',
				params,
			});
		},
		listRole: () => {
			return request({
				url: '/role/list',
				method: 'get'
			});
		},
		getRoleOptions: () => {
			return request({
				url: '/role/options',
				method: 'get',
			});
		},
		pageRole: (data: object) => {
			return request({
				url: '/role/page',
				method: 'post',
				data,
			});
		}
	};
}
